home *** CD-ROM | disk | FTP | other *** search
- @echo off
- goto SetVars
- :: //////////////////////////////////////////
- :: / Init.Bat /
- :: / author: w.burlew. /
- :: / NOTE: change environment vars /
- :: / [SDRV=?] [TDRV=?] & [DWDIR=?] /
- :: / if defaults are not suitable. /
- :: //////////////////////////////////////////
-
- :SetVars
- set SDRV=A:
- set TDRV=C:
- set DWDIR=DW
- goto begin
-
- ::======Invalid keypress
- :BadKey
- cls
- echo Please press the 'Y' or 'N' key!
- echo.
- pause
- goto begin
-
- ::======Start Batch
- :begin
- cls
- echo * * * DWProgs Installation & Print Documents Batch * * *
- echo.
- echo Ensure your printer is on to print the documents.
- echo Print Documents? (Y/N)
- bw
- if NOT errorlevel 90 if errorlevel 89 goto PrnYes
- if NOT errorlevel 79 if errorlevel 78 goto PrnNo
- goto BadKey
-
- ::======Print documents
- :PrnYes
- if NOT exist descrier.txt goto FErr
- echo Printing Descrier.Txt Please wait...
- type descrier.txt > prn
- if NOT exist register.frm goto FErr
- echo Printing Register.Frm Please wait...
- type register.frm > prn
- echo.
- echo Printing task completed.
- goto PrnNo
-
- ::======Prompt to install to hardrive
- :PrnNo
- echo.
- echo Installing these programs to your hard-drive is recommended.
- echo Ensure your [path] contains %tdrv%\%dwdir%;
- echo or whatever directory you placed the programs in.
- echo.
- echo Install to Hard-Drive? (Y/N)
- bw
- if NOT errorlevel 90 if errorlevel 89 goto InstYes
- if NOT errorlevel 79 if errorlevel 78 goto InstNo
- goto BadKey
-
- ::======Install the file(s)
- :InstYes
- echo Installing to %tdrv%\%dwdir% Please wait...
- echo.
- if exist %tdrv%\%dwdir%\NUL goto DirExists
- md %tdrv%\%dwdir%
- goto DoCopy
-
- ::=====Actual copy process
- :DoCopy
- dwcopy %sdrv%\*.* %tdrv%\%dwdir% /v
- %tdrv%
- cd\%dwdir%
- if exist init.bat del init.bat
- if exist bw.com del bw.com
- echo.
- echo Installation completed!
- echo.
- pause
- cls
- dir
- echo.
- echo Type one of the above executable program's name then press [enter]
- echo to execute any one of the program(s)...
- echo.
- goto fini
-
- ::=====Old DW dir found
- :DirExists
- echo %tdrv%\%dwdir% directory already exists.
- if exist %tdrv%\%dwdir%\*.* goto ProgsFound
- goto DoCopy
-
- ::=====Directory has files so move 'em
- :ProgsFound
- echo Moving old files to %tdrv%\OLDDW
- md %tdrv%\OLDDW
- dwmove %tdrv%\%dwdir%\*.* %tdrv%\OLDDW /v
- goto DoCopy
-
- ::======File(s) not found
- :FErr
- cls
- echo. [File Error]
- echo.
- echo Could not find all the "DW" program files...
- echo The "DW" program(s) must all be in the same directory.
- echo %0 terminating.
- echo.
- goto end
-
- ::======No install
- :InstNo
- echo.
- echo Batch terminated!
- goto ClrEnv
-
- ::======Hasta la vista
- :fini
- echo %0 process completed!
- goto ClrEnv
-
- ::======Clear environment
- :ClrEnv
- set SDRV=
- set TDRV=
- set DWDIR=
- goto end
-
- :end